package com.zj.service;

import com.zj.pojo.User;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Transactional  //开启事务3 一般写在 接口上表示 当前接口所有方法开启事务 也可写在方法上
//@Transactional(propagation = Propagation.REQUIRES_NEW)  //propagation = Propagation.REQUIRES_NEW 控制事务的传播行为 作为一个新事务  不与其他事务合并
public interface UserService {
    int balanceInById(int id,float balance);
    int balanceOutById(int id,float balance);
    List<User> transfer(User outUser,User inUser,float balance);
}
